
import {sm2} from 'sm-crypto'
import { getPublicKey } from '../apis/account/account';

export const doEncrypt=async (str:string)=>{

   const publicKey:string=await  getPublicKey().catch(()=>"");
   
   if(!publicKey){
       return "";
   }
   return  sm2.doEncrypt(str,publicKey);

}